Creating replicas at user-defined points in time

ABSTRACT

Example embodiments of the present invention relate to methods, systems, and computer program products for determining replicas for removal from a plurality of replicas as defined in a data retention policy. The method includes performing asynchronous replication from a source to a target according to time-based replication cycles. A retention policy then may be identified defining a number of asynchronous replication replicas to retain and a plurality of associated periods which then may be retained according to the policy.

CROSS REFERENCE TO RELATED APPLICATION

This Application is related to U.S. patent application Ser. No. ______ entitled “RETENTION POLICIES FOR UNSCHEDULED REPLICAS IN BACKUP, SNAPSHOTS, AND REMOTE REPLICATION” (EMC Docket No. EMC-15-0694) filed on even date herewith the teachings of which application are hereby incorporated herein by reference in their entirety.

A portion of the disclosure of this patent document may contain command formats and other computer language listings, all of which are subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.

TECHNICAL FIELD

This application relates to data replication.

BACKGROUND

Computer data is vital to today's organizations, and a significant part of protection against disasters is focused on data protection. As solid-state memory has advanced to the point where cost of memory has become a relatively insignificant factor, organizations can afford to operate with systems that store and process terabytes of data.

Conventional data protection systems include tape backup drives, for storing organizational production site data on a periodic basis. Such systems suffer from several drawbacks. First, they require a system shutdown during backup, since the data being backed up cannot be used during the backup operation. Second, they limit the points in time to which the production site can recover. For example, if data is backed up on a daily basis, there may be several hours of lost data in the event of a disaster. Third, the data recovery process itself takes a long time.

Another conventional data protection system uses data replication, by creating a copy of the organization's production site data on a secondary backup storage system, and updating the backup with changes. The backup storage system may be situated in the same physical location as the production storage system, or in a physically remote location. Data replication systems generally operate either at the application level, at the file system level, at the hypervisor level or at the data block level.

SUMMARY

Example embodiments of the present invention relate to methods, systems, and computer program products for determining replicas for removal from a plurality of replicas as defined in a data retention policy. The method includes performing asynchronous replication from a source to a target according to time-based replication cycles. A retention policy then may be identified defining a number of asynchronous replication replicas to retain and a plurality of associated periods which then may be retained according to the policy.

BRIEF DESCRIPTION OF THE DRAWINGS

Objects, features, and advantages of embodiments disclosed herein may be better understood by referring to the following description in conjunction with the accompanying drawings. The drawings are not meant to limit the scope of the claims included herewith. For clarity, not every element may be labeled in every Figure. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating embodiments, principles, and concepts. Thus, features and advantages of the present disclosure will become more apparent from the following detailed description of exemplary embodiments thereof taken in conjunction with the accompanying drawings in which:

FIG. 1 is a block diagram illustrating a system according to an example embodiment of the present invention;

FIG. 2 is a flow diagram illustrating a method for performing asynchronous replication from a source to a target according to time-based replication cycles according to an example embodiment of the present invention;

FIG. 3 is a state diagram illustrating time with replication cycle starts and elapsed time per replication cycle according to an example embodiment of the present invention;

FIG. 4 is a flow diagram illustrating a method for performing asynchronous replication from a source to a target according to a plurality of retention periods and replication cycle levels according to an example embodiment of the present invention;

FIG. 5 is a flow diagram illustrating a method for determining a time of a next asynchronous replication cycle switch according to an example embodiment of the present invention;

FIG. 6 is a block diagram of time having a plurality of retention windows each having respective pluralities of replicas according to an example embodiment of the present invention;

FIGS. 7A-7C are block diagrams of computing a score indicative of an importance of each replica in a range of replicas of the plurality of replicas for each respective retention windows of FIG. 6 according to an example embodiment of the present invention;

FIG. 8 is a flow diagram illustrating a method for determining replicas for removal from a plurality of replicas according to an example embodiment of the present invention;

FIG. 9 is a flow diagram illustrating a method for computing a score of each replica in a range of replicas of the plurality of replicas according to an example embodiment of the present invention;

FIG. 10 is a flow diagram illustrating a method for scoring a removing the replica with the minimum score from the window for each retention window according to an example embodiment of the present invention;

FIG. 11 is a flow diagram illustrating a plurality of methods for scoring replicas that may be employed individually or in combination according to an example embodiment of the present invention;

FIG. 12 is a block diagram of an apparatus according to an example embodiment of the present invention; and

FIG. 13 is a block diagram of a computer program product including an example embodiment of the present invention as embodied in computer program code.

DETAILED DESCRIPTION

Traditionally, many distributed systems use a consistent snapshot mechanism to replicate data between a source site and a target site. Typically, replication using a consistent snapshot mechanism is limited by the speed at which a storage system is able to complete replication cycles. Improvements to conventional replication using a consistent snapshot mechanism would be beneficial to the data storage industry.

Typically, a consistent snapshot is created from data within a storage system from one or more sources at the beginning of a replication cycle. Generally, once the data changes, those changes are transferred to a target site. Conventionally, upon completion of the data transfer, a snapshot is created at the target site which contains the same data as the snapshot(s) resident at the source site(s), thereby completing a replication cycle. Traditionally, each source site cannot send a subsequent snapshot until the completion of a replication cycle.

Conventionally, in asynchronous replication, there may be a lag between when, for example, a storage application at a source site sends a snapshot via asynchronous replication to a target site and when the source site receives an acknowledgement of the processing of that snapshot at the target site. In some embodiments, the lag time or latency may be expressed any number of ways such as no more than a given period of time, a set amount of data (i.e., number of blocks), or a number of data transactions. A period of time may vary or may be a predetermined period of time selected though user configuration.

In further embodiments, in asynchronous replication, there may be a chance of data loss that may occur as the acknowledgement of receipt of a snapshot has been logged before the snapshot is actually written to storage at the target site. If there is a crash between the acknowledgement and when the snapshot is written, this data may be lost. In alternative embodiments, asynchronous replication may offer the ability to run the production site with little or no slowing due to data protection requirements. This may be because replication requirements, in terms of data needed to be replicated, may not be constant and may fluctuate. Asynchronous data replication may offer a buffer or lag which may buffer data replication, allowing it to build up during heavy replication periods and allowing it to catch up during lighter replication periods.

Traditional asynchronous replication products, such as Symmetrix Remote Data Facility (SRDF®) Asynchronous mode (SRDF/A) by EMC Corporation of Hopkinton, Mass., use replication cycles to minimize lag, where each cycle starts immediately when the previous cycle finished. When this tradition asynchronous replication is combined with maintaining the resulting consistent points-in-time (PITs) on the target site, a user can enjoy a history of past PIT replicas. However, because the creation of new cycles is unpredictable (i.e., it depends on the completion of the previous cycle) in traditional asynchronous replication, the timing of these replicas is also unpredictable.

Conventionally, data replication policies may describe different types of recovery, such as disaster recovery, operational recovery, and logical corruption recovery, and have a plurality of policy attributes, such as frequency of snapshots taken at the source site and how long each snapshot is kept at the target site, remote replica lag (e.g. the length of time during which updates may be lost in case of a source site failure), recovery point objective (RPO) (i.e., the maximum acceptable lag time between the time data is committed to the source site and the time it is committed to the target site or an acceptable amount of data loss measured in time), recovery time objective (RTO) (i.e., the time taken to perform the recovery), number of copies, automated storage tiering, and location. The policy attributes also may include the number of copies, the type of replication (i.e., SRDF or EMC RecoverPoint®, both by EMC Corporation of Hopkinton, Mass.), the mode of replication (i.e., synchronous, asynchronous, continuous data protection (CDP), point in time (PIT)), source engine type, and target engine type (i.e., Symmetrix® or VNX®, both by EMC Corporation of Hopkinton, Mass.).

Moreover, in typical data protection environments, there are competing objectives that may require tradeoffs in policy compliance. For example, RPO competes with application latency and a protection window (i.e., how far back in time is data protected) competes with snapshot granularity (i.e., how often data is backed-up) which, in turn, competes with target site processing storage size (i.e., the amount of storage needed for storing new data received while accessing an image on the target side). For example, in certain embodiments, the source site may slow down its response time which will result in less new data coming from users, thus reducing RPO as less data accumulates.

Traditional data protection environments are deficient in that they: (1) maintain only the last consistent copy (i.e., do not support preserving multiple PIT copies from different times); (2) maintain all copies (this will result in running out of space, or require user to constantly monitor and remove redundant copies); (3) maintain last N copies, where N is a user-defined number (this method results in an unpredictable protection window, and possibly redundant copies (e.g., a copy from 24 hours ago and 24.01 hours ago)); and (4) use a retention policy that dilutes PIT copies based on a user's requirements (this will approximate the desired result but will not guarantee it (i.e., if a user wants a PIT every minute but cycles are 30 minute long, it is impossible to respect the user's policy)).

Example embodiments of the present invention recognize that it is desirable to respect a user policy that requires a certain schedule for PIT replicas (e.g., 5 in the last 10 minutes and 24 in the last 24 hours) while continuing to minimize the lag between the source and the target. Further, according to example embodiments of the present invention, it is possible to select which copies to retain automatically based on the time they were created, or the amount of data they protect, or the amount of changes they contain. Accordingly, with enough resources (e.g., storage space), example embodiments of the present invention are able to respect the exact policy requirements of the user with no compromise.

The words PIT, snapshot, and replica may be used interchangeably throughout.

FIG. 1 is a block diagram illustrating a system 100 according to an example embodiment of the present invention. As illustrated in FIG. 1, the system 100 includes a source site 110 and a target site 120. The source site 110 includes a host 115, a storage application 130, and storage 135. The target site 120 includes a replica manager 150 which may manage a plurality of replicas 160 _(1-N) (160 generally) according to a policy 165. The host 115 may perform I/O 117 operations on the storage 135, which may be intercepted by the storage application 130. As changes are made to the storage 135 via the I/O operations 117 from the host 115, the storage application 130 may perform asynchronous replication 140 from the source site 110 to the target site 120. As will be described in greater detail below, in example embodiments of the present invention, the timing of the asynchronous replication cycles and the retention of the replicas may be managed by the replica manager 150 at the target site 120.

FIG. 2 is a flow diagram illustrating a method for performing asynchronous replication from a source to a target according to time-based replication cycles according to an example embodiment of the present invention. FIG. 2 may be described in conjunction with FIG. 1. As illustrated in FIG. 2 asynchronous replication may be performed from a source site 110 to a target site 120 according to time-based replication cycles (205). A retention policy 165 may be identified defining a number of asynchronous replication replicas to retain and a plurality of associated periods (i.e., retention windows) (210). As described above, the retention policy 165 also may include other policy attributes, such as frequency of snapshots taken at the source site and how long each snapshot is kept at the target site, remote replica lag, RPO, RTO, automated storage tiering, and location. Asynchronous replication replicas 160 then may be retained according to the policy 165.

In certain embodiments, the plurality of periods may be a sequence of periods such that each successive period in the plurality of periods is a multiple of an immediately preceding period in the plurality of periods. For example, for a plurality of periods, L₀, L₁, L₂, L₃, etc. (in seconds.), L0 divides evenly into L1, L1 divides evenly into L2, etc. The set of requirements L=(L₀, L₁, L₂, L₃, . . . ) may be interpreted as follows:

-   -   L₀ is the minimal lag. Example embodiments of the present         invention will attempt to switch asynchronous replication cycles         at least (but not more often than) every L₀ seconds (in other         words, L₀ is derived from the RPO or maximal amount of allowed         data loss when recovering from the latest PIT).     -   L₁ is the first retention period (a PIT is created every L₁         seconds and is saved during the L₂ period); L₂ is the second         retention period (a PIT is created every L₂ seconds and is saved         during the L₃ period); Etc.

For example, the set of numbers L₀=5, L₁=60, L₂=3600, L₃=86400 provides a minimal lag of 5 seconds, where the target site 120 has a PIT replica 160 every minute for the last hour, and every hour for the last day, as will be described in greater detail below. In a preferred embodiment, each window excludes all replicas 160 from previous retention windows. In certain embodiments, the policy 165 may define a limit on a number of PIT copies to retain for each retention period (which may be arbitrary, including 0). For example, a policy 165 may specify “5 in the last 12 minutes”, “2 in the last hour”, and “24 in the last 24 hours”. In some embodiments, the windows are ordered by size (e.g., from small to large). In some embodiments, the retention windows are defined between “now” and a previous point in time in the past.

FIG. 3 is a state diagram illustrating time with replication cycle starts and elapsed time per replication cycle according to an example embodiment of the present invention. As illustrated in FIG. 3, the X axis shows the elapsed time per asynchronous replication cycle, with each replication cycle starting at, for example, 0 seconds relative to itself (but with the cycle time of each previous cycle being the absolute replication cycle start time) and the Y axis shows time with replication cycle starts. In other words, in general, the start of asynchronous replication cycle C[P₀]=2 occurs following the completion of the asynchronous replication cycle C[P₀]=1 immediately preceding it (with the exception of asynchronous replication cycle C[P₁]=2 as will be described in greater detail below), particularly with reference to FIG. 4.

FIG. 4 is a flow diagram illustrating a method for performing asynchronous replication from a source 110 to a target 120 according to a plurality of retention periods and replication cycle levels according to an example embodiment of the present invention. FIG. 4 may be described in conjunction with FIGS. 1 and 3. As illustrated in FIG. 4, the asynchronous replication policy is defined to have a minimal lag of L₀ and, therefore, asynchronous replication cycle switches are attempted at least as often as every L₀ seconds. If the asynchronous replication system 100 has sufficient resources it should be able to attain this replication goal and asynchronously replicate a new snapshot every L₀ (i.e., 5) seconds. In this case, link bandwidth is sufficient for transmitting host writes, when peak writes may be smoothed over the L₀ period (in other words, the amount of writes in any window of L₀ seconds is not more than the transfer capacity of the links over L₀ seconds). In this case, we are guaranteed that cycle switching can occur exactly every L₀ seconds.

As illustrated in FIGS. 1, 3, and 4, a first asynchronous replication cycle may start (405). The cycle may be a first type (i.e., having a first retention period) of P₀ and an associated counter for the first cycle type may be incremented (i.e., C[P₀]++) (410) to C[P₀]=1. The replica manager 150 then may determine whether the counter C[P₀] is equal to (or a multiple of) the ratio of the second retention period (i.e., L₁) and the first retention period (i.e., L₀) (i.e., is C[P₀]=L₁/L₀?) (415). If C[P₀] is not equal to (or a multiple of) the ratio of the second retention period (i.e., L₁) and the first retention period (i.e., L₀) (i.e., C[P₀]≠L₁/L₀) (417) then the next replication cycle pay be performed (405) which will trigger an increment of the counter for the first cycle type of P₀ (i.e., C[P₀]++) (410) to C[P₀]=2. The replica manager 150 will continue to determine that the counter C[P₀] is not equal to (or a multiple of) the ratio of the second retention period (i.e., L₁) and the first retention period (i.e., L₀) (i.e., C[P₀]≠L₁/L₀) (417) through C[P₀]=(L₁/L₀)−1 (here, cycle 11 of type P₀ as L₀=5 and L₁=60).

For cycle 12 of type P₀ (i.e., C[P₀]=L₁/L₀=12 as L₀=5 and L₁=60), the replica manager will determine that [P₀] is equal to (or a multiple of) the ratio of the second retention period (i.e., L₁) and the first retention period (i.e., L₀) (i.e., C[P₀]=L₁/L₀) (418) and will increment an associated counter for a second cycle type (i.e. C[P₁]++) (420) and mark the cycle L₁/L₀ as of the second type (i.e., P₁). The replica manager may then reset the counter for the first cycle type (i.e., C[P₀]=0) (425). Alternatively, the replica manager may skip this resetting step as the replica manager may determine whether the counter for the first cycle type is a multiple of the ration of the second retention period (i.e., L₁) and the first retention period (i.e., L₀) (i.e., is C[P₀]=L₁/L₀?).

The replica manager then may determine whether the marking of cycle L₁/L₀ of the first type as a cycle of the second type caused the counter for the second cycle type to be equal to (or a multiple of) the ration of the third retention period (i.e., L₂) and the second retention period (i.e., L₁) (i.e., is C[P₁]=L₂/L₁?) (430). Similar to the discussion above, if C[P₁] is not equal to (or a multiple of) the ratio of the third retention period (i.e., L₂) and the second retention period (i.e., L₁) (i.e., C[P₁]≠L₂/L₁) (432) then the next replication cycle pay be performed (405) which will trigger an increment of the counter for the first cycle type of P₀ (i.e., C[P₀]++) (410) to C[P₀]=1. Asynchronous replication may continue to be performed, with C[P₀] continuing to be incremented through groups of L₁/L₀ which, in turn, cause each L₁/L₀ cycle to be marked as the second type (i.e., P₁) and the associated counter for the second cycle type to be incremented (i.e. C[P₁]++) (420) until the counter for the second cycle type is equal to (or a multiple of) the ratio of the third retention period (i.e., L₂) and the second retention period (i.e., L₁) (i.e., C[P₁]=L₂/L₁) (433). As illustrated in FIG. 4, the above arrangement of incrementing counters and marking cycles continues through successive levels for each retention period L₀-L_(N).

For example, for the set of retention period values L₀=5, L₁=60, L₂=3600, L₃=86400, every 12^(th) snapshot (i.e., L₁/L₀=60/5=12) will be marked as P₁ to be retained at the target side for 1 minute (i.e., L₁=60 seconds). Likewise, every 60^(th) snapshot marked P₁ (i.e., L₂/L₁=3600/60=60) will be marked as P₂ to be retained at the target side for 1 hour (i.e., L₂=3600 seconds). Similarly, every 24^(th) snapshot marked P2 (i.e., L3/L2=86400/3600=24) will be marked as P3 to be retained at the target side for 24 hours (i.e., L3=86400 seconds). It should be understood that the marking of the snapshots is transferred from the source site to the target site so the replica manager 150 may manage the retention of the replicas 160 according to the policy 165.

FIG. 5 is a flow diagram illustrating a method for determining a time of a next asynchronous replication cycle switch according to an example embodiment of the present invention. In certain embodiments, host writes may exceed the average link bandwidth between the source site 110 and the target site 120 and, in this case, an asynchronous replication cycle may not be able to finish within L₀ seconds. For example, using L₀=5 seconds in our example, it may take 20 seconds, a minute, an hour, or more. Accordingly, when a cycle exceeds its minimal cycle time L₀, according to example embodiments of the present invention, the system 100 uses the following method to determine the time of the next cycle switch.

FIG. 5 may be described in conjunction with FIG. 3. In a preferred embodiment, the method described below is performed in conjunction with marking the cycles as P₁, P₂, P₃, . . . as described above with respect to FIG. 4.

The system 100 may perform a first asynchronous replication cycle of type P₀ (505) and determine whether cycle transmission is complete (510).

If cycle transmission is complete (512), the system 100 determines how much time elapsed in completing the asynchronous replication cycle (515).

If the amount of elapsed time for the completed asynchronous replication cycle is up to and including L₁−L₀ (i.e., T≦L₁−L₀) (517), the system 100 may continue with the next asynchronous replication cycle of type P₀ (505). For example, as illustrated in FIG. 3, transmission of asynchronous replication cycle C[P₀]=1 completed before L₁−L₀ (i.e., 55 secs.) and the system 100 may continue with the next asynchronous replication cycle of type P₀, C[P₀]=2 upon completion of asynchronous replication cycle C[P₀]=1.

If the amount of elapsed time for the completed asynchronous replication cycle is after L₁−L₀ (i.e., 55 secs.) but before L₁ (i.e., 60 secs.) (i.e., L1−L0<T<L1) (518), the system 100 may wait until L₁ seconds pass (e.g., in order to align cycle times with L₁). For example, as illustrated in FIG. 3, transmission of asynchronous replication cycle C[P₀]=2 completed after L₁−L₀ (i.e., 55 secs.) but before L₁ (i.e., 60 secs.) and the system 100 waits until the amount of elapsed time is L₁ (i.e., 60 secs.) (i.e., T=L₁) (519) before continuing with the next asynchronous replication cycle of type P₀, C[P₀]=3 (not shown). In other words, in example embodiments of the present invention there are no partial cycles spanning L₁.

If asynchronous replication cycle transmission is not complete (513), the system 100 determines how much time has elapsed in the asynchronous replication cycle (520). If the amount of elapsed time for the asynchronous replication cycle is before L₁ (i.e., 60 secs.) (i.e., T<L₁) (522), the system 100 allows the asynchronous replication cycle to continue to resume monitoring whether the cycle is complete (510).

However, if asynchronous replication cycle transmission is not complete and the amount of elapsed time for the asynchronous replication cycle is L₁ (i.e., 60 secs.) (i.e., T=L₁) (523), the system 100 forces creation of a new asynchronous replication cycle at the source site 110 and marks it of type P₁ (525). It should be noted that transmission of the existing asynchronous replication cycle continues. For example, as illustrated in FIG. 3, transmission of asynchronous replication cycle C[P₀]=6 is not complete at L₁ (i.e., 60 secs.), the system 100 forces the source site 110 to create a new asynchronous replication cycle of type P₁ C[P₁]=2 (note C[P₁]=1 was created previously in the L₁/L₀ cycle), and the existing asynchronous replication cycle C[P₀]=6 continues until it completes some time after L₁.

It should be noted that, in certain embodiments, because forcing the start of new asynchronous replication cycles may happen multiple times, the number of cycles at the source site 110 can grow to any number the system 100 can support (e.g., according to its resources). Further, the system may adjust the frequency at which new asynchronous replication cycles are started if transmission of the cycles is not able to complete before the start of the next cycle or cap the number of allowed cycles on the source site 110. However, it is important to note that, certain embodiments of the present invention address temporary resource shortages that may resolve themselves and allow the asynchronous replication system to catch up transmission of a backlog of asynchronous replication cycles.

FIG. 6 is a block diagram of time having a plurality of retention windows P₁ 620 ₁, P₂ 620 ₂, and P₃ 620 ₃ (620 generally), with P1 covering the range T₀=0 secs. to T₁=−12 mins. (i.e., L₁/L₀), P₂ covering the range T₁ to T₂=−1 hour (i.e., L₂/L₁), and P₃ covering the range T₂ to T₃=−24 hours (i.e., L₃/L₂). Each retention window 620 has a respective pluralities of replicas 610 ₁₋₁₀, 610 ₁₁₋₄₀, 610 ₄₁₋₈₈ (610 generally) according to an example embodiment of the present invention. The replicas 610 (e.g., replicas 160 of FIG. 1) are at a target site 120 and a replica manager 150 may execute a retention policy 165 to determine respective replicas 160 from the retention windows 620 to retain for periods of time.

As illustrated in FIG. 6, there are 10 replicas 610 ₁₋₁₀ in the first window P₁ 620 ₁, 30 replicas 610 ₁₁₋₄₀ in the second window P₂ 620 ₂, and 48 replicas 610 ₄₁₋₈₈ in the third window P₃ 620 ₃. However, in this example embodiment, the retention policy 165 defines that the first window P₁ 620 ₁ should retain 5 replicas in the past 12 minutes, the second window P₂ 620 ₂ should retain 2 replicas in the past hour (excluding those replicas in all previous windows (i.e., P₁ 620 ₁), and the third window P₃ 620 ₃ should retain 24 replicas in the past 24 hours (excluding those replicas in all previous windows (i.e., P₁ 620 ₁ and P₂ 620 ₂), with the number of extraneous replicas in each window 620 represented by the hashes. As will be described in greater detail below, new snapshots are received at the target site 120 at unpredictable times and example embodiments of the present invention may decide which snapshots to keep and which snapshots to eliminate (e.g., based on the time they were created, the amount of data they protect, or the amount of changes they contain). In other embodiments, the time windows may overlap such that replicas in the previous windows are included.

FIGS. 7A-7C are block diagrams of computing a score indicative of an importance of each replica in a range of replicas of the plurality of replicas for each respective retention windows of FIG. 6 according to an example embodiment of the present invention. FIGS. 7A-7C may be described in conjunction with FIG. 8, which is a flow diagram illustrating a method for determining replicas for removal from a plurality of replicas according to an example embodiment of the present invention. As illustrated in FIGS. 7A-7C and 8, the replica manager 160 may identify a set of user conditions associated with the first window P₁ as defined in the data retention policy 165 (805). For example, the replica manager 160 may determine from the data retention policy 165 that the first window P₁ should retain 5 replicas in the past 12 minutes, the second window P₂ should retain 2 replicas in the past hour, and the third window P₃ should retain 24 replicas in the past 24 hours.

As illustrated in FIGS. 7A and 8, for the first window (e.g., first window P₁ 620 ₁ of FIG. 6), the replica manager 160 may determine a plurality of replicas satisfying the user condition (i.e., window) having a time value in the associated time window (810). In other words, the replica manager 160 may determine there are 10 replicas 760 ₁₋₁₀ in the first window P₁. Similarly, for FIGS. 7B, 7C, and 8, the replica manager 160 may determine there are 30 replicas 760 ₁₁-760 ₄₀ and 48 replicas 760 ₄₁-760 ₈₈ in the second and third windows, respectively (810). The replica manager 160 then may determine whether the plurality of replicas exceeds a maximum for each window as defined in the data retention policy (i.e., 5 in the first window P₁, 2 in the second window P₂, and 24 in the third window P₃) and, if so, remove extraneous replicas from the plurality of replicas so the plurality of replicas does not exceed the maximum for the window (815).

FIG. 9 is a flow diagram illustrating a method for computing a score of each replica in a range of replicas of the plurality of replicas according to an example embodiment of the present invention. As illustrated in FIG. 9, in order to determine which replicas of the plurality of replicas should be retained and which replicas should be removed in order to comply with the retention policy, the replica manager 160 generates a score for each replica. As will be described in greater detail below with respect to FIG. 10, the replica manager 160 identifies a previous replica relative to the replica being scored (905) and identifies a subsequent replica relative to the replica being score (910). The replica manager 160 then, as will be described in greater detail below with respect to FIG. 10, may compute the score according to values associated with the previous, score, and subsequent replicas (915).

FIG. 10 is a flow diagram illustrating a method for scoring a removing the replica with the minimum score from the window for each retention window according to an example embodiment of the present invention. FIG. 10 may be described with reference to FIGS. 7A-7C. The replica manager 160 may examine the first window P₁ (1005) and count the number of replicas in the window P₁ (ignoring any copies that belong to the previous window, if any) (1010). Thus, the replica manager 160 may determine that there are 10 replicas in the first window P₁ of FIG. 7A and determine whether the number of replicas n is at least 2 but within the user policy maximum M for the first window P₁ (i.e., is 2≧n≦M?) (1015).

If the number of copies n is within the user policy (1017) the replica manager may proceed to the next retention window P₂ (1005). However, if the number of copies n exceeds the user policy maximum for the window M (i.e., n>M) (1018) the replica manager 160 may automatically retain the first and latest replicas in the retention window P₁ (i.e., replicas C₁ and C_(n) in the set of replicas {C₁, . . . , C_(n)}) (e.g., latest replica 760 ₁ and first replica 760 ₁₀ of FIG. 7A) (1020).

The replica manager 160 then may compute a score S[j] for each of the remaining replicas in the retention window P₁ (i.e., replicas Cj when 1<j<n) (e.g., replicas 760 ₂-760 ₉ of FIG. 7A) (1025). Example methods for computing the score will be described below with reference to FIG. 11. The replica with the minimum score (i.e., S_(MIN) in the set of scores {S₂, . . . , S_(n−1)}) then may be removed from the retention window P₁ (1030). The method then return to recursively determine whether the number of replicas satisfies the policy (1015) until it does (1017).

The replica manager 160 may determine whether it has examined the last retention window (1035) and, if it has not (1037), it was transition to the next (e.g., second) retention window (1005) and determine the number of replicas in the second retention window P₂ (1010). Thus, the replica manager 160 may determine that there are 30 replicas in the second window P₂ of FIG. 7B and determine whether the number of replicas n is at least 2 but within the user policy maximum M for the first window P₂ (i.e., is 2≧n≦M?) (1015).

If the number of copies n is within the user policy (1017) the replica manager may proceed to the next retention window P₃ (1005). However, if the number of copies n exceeds the user policy maximum for the window M (i.e., n>M) (1018) the replica manager 160 may automatically retain the first and latest replicas in the retention window P₂ (i.e., replicas C₁ and C_(n) in the set of replicas {C₁, . . . , C_(n)}) (e.g., latest replica 760 ₁₁ and first replica 760 ₄₀ of FIG. 7B) (1020).

The replica manager 160 then may compute a score S[j] for each of the remaining replicas in the retention window P₂ (i.e., replicas Cj when 1<j<n) (e.g., replicas 760 ₁₂-760 ₃₉ of FIG. 7B) (1025). Example methods for computing the score will be described below with reference to FIG. 11. The replica with the minimum score (i.e., S_(MIN) in the set of scores {S₂, . . . , S_(n−1)}) then may be removed from the retention window P₂ (1030). The method then return to recursively determine whether the number of replicas satisfies the policy (1015) until it does (1017).

The replica manager 160 may determine whether it has examined the last retention window (1035) and, if it has not (1037), it was transition to the next (e.g., third) retention window (1005) and determine the number of replicas in the second retention window P₃ (1010). Thus, the replica manager 160 may determine that there are 48 replicas in the third window P₃ of FIG. 7C and determine whether the number of replicas n is at least 2 but within the user policy maximum M for the first window P₂ (i.e., is 2≧n≦M?) (1015).

If the number of copies n is within the user policy (1017) the replica manager may attempt to proceed to the next retention window, but the replica manager will determine whether P₃ is the last window (1035) (which it is (1038)) and end (1040). However, if the number of copies n exceeds the user policy maximum for the window M (i.e., n>M) (1018) the replica manager 160 may automatically retain the first and latest replicas in the retention window P₃ (i.e., replicas C₁ and C_(n) in the set of replicas {C₁, . . . , C_(n)}) (e.g., latest replica 760 ₄₁ and first replica 760 ₈₈ of FIG. 7C) (1020).

The replica manager 160 then may compute a score S[j] for each of the remaining replicas in the retention window P₃ (i.e., replicas Cj when 1<j<n) (e.g., replicas 760 ₄₂-760 ₈₇ of FIG. 7C) (1025). Example methods for computing the score will be described below with reference to FIG. 11. The replica with the minimum score (i.e., S_(MIN) in the set of scores {S₂, . . . , S_(n−1)}) then may be removed from the retention window P₃ (1030). The method then return to recursively determine whether the number of replicas satisfies the policy (1015) until it does (1017), at which point the replica manager will determine whether P₃ is the last window (1035) (which it is (1038)) and end (1040).

FIG. 11 is a flow diagram illustrating a plurality of methods for scoring replicas that may be employed individually or in combination according to an example embodiment of the present invention. As illustrated in FIG. 11, the replica manager 160 may compute the score S[j] for each of the remaining replicas in the retention windows (i.e., replicas Cj when 1<j<n) (e.g., replicas 760 ₂-760 ₉ of FIG. 7A for the first retention window P₁, replicas 760 ₁₂-760 ₃₉ of FIG. 7B for the second retention window P₂, and replicas 760 ₄₂-760 ₈₇ of FIG. 7C for the third retention window P₃) (1130). As described above with respect to FIG. 9, in example embodiments, the score for a replica is calculated according to values associated with the previous, scored, and subsequent replicas. The replica manager then may determine if it has scored the last replica (i.e., when j=n−1) (1150). If replicas still remain in the retention window being scored (i.e., j<n−1) (1152) the replica manager then may score the next replica (1130). However, if the replica manager has scored the last replica (i.e., j=n−1) (1153) then the scoring method ends (1140).

A first example embodiment scoring method may be based on time. The replica manager 160 may determine the time of the previous replica (i.e., T_(j−1)) (1135A) and determine the time of the subsequent replica (i.e., T_(j+1)) (1140A). The replica manager 160 then may compute the score according to the difference between the times of the previous replica and the subsequent replica (i.e., S[j]=T_(j+1)−T_(j−1)) (1145A). It should be understood that the bigger the gap, the more important j is. Further, the resulting replicas are distributed more evenly as possible in time. For example, for a user which asks for 24 replicas in the last 24 hours, example embodiments of the present invention will converge (under normal conditions) to a replica every hour.

A second example embodiment scoring method may be based on the amount of data changed. The replica manager 160 may determine the amount of data written at the time of the previous replica (i.e., D[T_(j−1)]) (1135B) and determine the amount of data written at the time of the subsequent replica (i.e., D[T_(k+1)]) (1140B). The replica manager 160 then may compute the score according to the difference between the amount of data at the time of the previous replica and the subsequent replica (i.e., S[_(j)]=D[T_(j+1)]−D[T_(j−1)]) (1145B). It should be understood that replicas representing the greatest amount of data have a higher score. Further, the resulting replicas converge to even amount of changes (e.g., in bytes) between replicas.

A third example embodiment scoring method may be based on the number of writes. The replica manager 160 may determine the number of writes between the previous replica and the scored replica (i.e., W_(j−1) _(→j) ) (1135C) and determine the number of writes between the scored replica and the subsequent replica (i.e., W_(j) _(→) _(j+1)) (1140C). The replica manager 160 then may compute the score according to the number of writes between the previous replica and the subsequent replica (i.e., S[j]=W_(j) _(→) _(j+1)−W_(j−1) _(→j) ) (1145C). It should be understood that the number of writes represented by each replica gives that replica a higher value. Further, the resulting replicas converge to an even number of changes (e.g., in I/Os) between replicas.

It should be understood that each of the three methods of scoring replicas may be used individually or in combination. Additional methods may be constructed to weigh a combination of the above factors (e.g., time difference, byte difference, and IO difference) to calculate any user-defined score S[j] for a copy Cj. For example, the score can be the sum of normalized values of the scores discussed above.

FIG. 12 is a block diagram of an example embodiment apparatus 1205 according to the present invention. The apparatus 1205 may be part of a system 1200 and includes memory 1210 storing program logic 1215, a processor 1220 for executing a process 1225, and a communications I/O interface 1230, connected via a bus 1235.

Processing may be implemented in hardware, software, or a combination of the two. Processing may be implemented in computer programs executed on programmable computers/machines that each includes a processor, a storage medium or other article of manufacture that is readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and one or more output devices. Program code may be applied to data entered using an input device to perform processing and to generate output information.

The methods and apparatus of this invention may take the form, at least partially, of program code (i.e., instructions) embodied in tangible non-transitory media, such as floppy diskettes, CD-ROMs, hard drives, random access or read only-memory, or any other machine-readable storage medium. When the program code is loaded into and executed by a machine, such as the computer of FIG. 12, the machine becomes an apparatus for practicing the invention. When implemented on one or more general-purpose processors, the program code combines with such a processor to provide a unique apparatus that operates analogously to specific logic circuits. As such, a general purpose digital machine can be transformed into a special purpose digital machine.

FIG. 13 is a block diagram of a computer program product 1300 including program logic 1355, encoded on a computer-readable medium 1360 in computer-executable code configured for carrying out the methods of the invention, according to an example embodiment of the present invention. The logic for carrying out the method may be embodied as part of the aforementioned system, which is useful for carrying out a method described with reference to embodiments shown.

Although the foregoing invention has been described in some detail for purposes of clarity of understanding, it will be apparent that certain changes and modifications may be practiced within the scope of the appended claims. The scope of the invention is limited only by the claims and the invention encompasses numerous alternatives, modifications, and equivalents. Numerous specific details are set forth in the above description in order to provide a thorough understanding of the invention. These details are provided for the purpose of example and the invention may be practiced according to the claims without some or all of these specific details. For the purpose of clarity, technical material that is known in the technical fields related to the invention has not been described in detail so that the invention is not unnecessarily obscured. Accordingly, the above implementations are to be considered as illustrative and not restrictive, and the invention is not to be limited to the details given herein, but may be modified within the scope and equivalents of the appended claims. 

What is claimed is:
 1. A method comprising: performing asynchronous replication from a source to a target according to time-based replication cycles; identifying a retention policy defining a number of asynchronous replication replicas to retain and a plurality of associated periods; and retaining asynchronous replication replicas according to the policy.
 2. The method of claim 1 wherein identifying a retention policy defining a number of asynchronous replication replicas to retain and a plurality of associated periods comprises defining each successive period in the plurality of periods as a multiple of an immediately preceding period in the plurality of periods.
 3. The method of claim 2 wherein retaining asynchronous replication replicas according to the policy comprises retaining, for each successive period, a number of asynchronous replication replicas from the immediately preceding period in the plurality of periods.
 4. The method of claim 3 wherein a first period among the plurality of periods defines a minimal lag establishing a lower threshold of time between asynchronous replication cycles derived from a Recovery Point Objective defining a maximum amount of permitted data loss associated with recovery from the target.
 5. The method of claim 1 wherein performing asynchronous replication from a source to a target according to time-based replication cycles comprises, at a source side: for each asynchronous replication cycle of a first level having a position in a series of replication cycles equal to a first multiple of a ratio of a first period and a second period, marking the asynchronous replication cycle of the first level as an asynchronous replication cycle of a second level; and for each asynchronous replication cycle of the of the second level having a position in the series of replication cycles equal to a second multiple of a ratio of the second period and a third period, marking the asynchronous replication cycle of the second level as an asynchronous replication cycle of a third level.
 6. The method of claim 5 further comprising, at a target side: preserving each asynchronous replication cycle marked as the second level for the second period; and preserving each asynchronous replication cycle marked as the third level for the third period.
 7. The method of claim 5 further comprising, for asynchronous replication cycles having a transmission time exceeding the first period, determining a time of a next asynchronous replication cycle switch.
 8. The method of claim 7 wherein determining a time of a next asynchronous cycle switch comprises, if the asynchronous replication cycle transmission time is less than or equal to the difference between the second period and the first period, starting the next asynchronous replication cycle.
 9. The method of claim 7 wherein determining a time of a next asynchronous cycle switch comprises, if the asynchronous replication cycle transmission time is greater than the difference between the second period and the first period less than the second period: waiting until completion of the second period; and starting the next asynchronous replication cycle.
 10. The method of claim 7 wherein determining a time of a next asynchronous cycle switch comprises, if the asynchronous replication cycle transmission time is greater than the second period: starting the next asynchronous replication cycle; and continuing transmission of the asynchronous replication cycle.
 11. A system comprising: a processor; and memory storing computer program code that when executed on the processor causes the processor to execute an asynchronous replication process operable to perform the operation sof: performing asynchronous replication from a source to a target according to time-based replication cycles; identifying a retention policy defining a number of asynchronous replication replicas to retain and a plurality of associated periods; and retaining asynchronous replication replicas according to the policy.
 12. The system of claim 11 wherein computer program code operable to perform the operation of identifying a retention policy defining a number of asynchronous replication replicas to retain and a plurality of associated periods comprises computer program code operable to perform the operation of defining each successive period in the plurality of periods as a multiple of an immediately preceding period in the plurality of periods.
 13. The system of claim 12 wherein computer program code operable to perform the operation of retaining asynchronous replication replicas according to the policy comprises computer program code operable to perform the operation of retaining, for each successive period, a number of asynchronous replication replicas from the immediately preceding period in the plurality of periods.
 14. The system of claim 13 wherein a first period among the plurality of periods defines a minimal lag establishing a lower threshold of time between asynchronous replication cycles derived from a Recovery Point Objective defining a maximum amount of permitted data loss associated with recovery from the target.
 15. The system of claim 11 wherein computer program code operable to perform the operation of performing asynchronous replication from a source to a target according to time-based replication cycles comprises computer program code operable to perform the operation of, at a source side: for each asynchronous replication cycle of a first level having a position in a series of replication cycles equal to a first multiple of a ratio of a first period and a second period, marking the asynchronous replication cycle of the first level as an asynchronous replication cycle of a second level; and for each asynchronous replication cycle of the of the second level having a position in the series of replication cycles equal to a second multiple of a ratio of the second period and a third period, marking the asynchronous replication cycle of the second level as an asynchronous replication cycle of a third level.
 16. The system of claim 15 further comprising computer program code operable to perform the operation of, at a target side: preserving each asynchronous replication cycle marked as the second level for the second period; and preserving each asynchronous replication cycle marked as the third level for the third period.
 17. The system of claim 15 further comprising computer program code operable to perform the operation of, for asynchronous replication cycles having a transmission time exceeding the first period, determining a time of a next asynchronous replication cycle switch.
 18. The system of claim 17 wherein computer program code operable to perform the operation of determining a time of a next asynchronous cycle switch comprises computer program code operable to perform the operation of, if the asynchronous replication cycle transmission time is less than or equal to the difference between the second period and the first period, starting the next asynchronous replication cycle.
 19. The system of claim 17 wherein computer program code operable to perform the operation of determining a time of a next asynchronous cycle switch comprises computer program code operable to perform the operation of, if the asynchronous replication cycle transmission time is greater than the difference between the second period and the first period less than the second period: waiting until completion of the second period; and starting the next asynchronous replication cycle.
 20. The system of claim 17 wherein computer program code operable to perform the operation of determining a time of a next asynchronous cycle switch comprises computer program code operable to perform the operation of, if the asynchronous replication cycle transmission time is greater than the second period: starting the next asynchronous replication cycle; and continuing transmission of the asynchronous replication cycle.
 21. A computer program product including a non-transitory computer readable storage medium having computer program code encoded thereon that when executed on a processor of a computer causes the computer to execute an asynchronous data replication process comprising: computer program code for performing asynchronous replication from a source to a target according to time-based replication cycles; computer program code for identifying a retention policy defining a number of asynchronous replication replicas to retain and a plurality of associated periods; and computer program code for retaining asynchronous replication replicas according to the policy. 